Lemon Squeezy
Merchant of record platform for digital products. Acquired by Stripe in October 2024. Being absorbed into 'Stripe Managed Payments' (announced May 2025, private preview). No official Python SDK exists — only community-maintained libraries. REST API uses JSON:API spec with Bearer auth.
Warnings
- breaking Lemon Squeezy was acquired by Stripe in October 2024. As of May 2025, Stripe announced 'Stripe Managed Payments' as the successor merchant of record product. Lemon Squeezy's API may be deprecated or migrated to Stripe infrastructure in the future. New integrations should evaluate Stripe Managed Payments (waitlist) instead.
- breaking No official Python SDK exists. All PyPI packages named 'lemonsqueezy*' are unofficial, may be abandoned, and have no support from Lemon Squeezy / Stripe.
- gotcha The Lemon Squeezy API follows JSON:API spec. Response payload is wrapped: response['data'] contains the resource(s), not the top-level response. Code accessing response['products'] or response['id'] directly fails.
- gotcha Both Accept and Content-Type headers must be 'application/vnd.api+json', not 'application/json'. Sending standard JSON headers returns 406 Not Acceptable.
- gotcha Lemon Squeezy has Test mode (separate from live). Test mode API keys start with a different prefix. Using a live key in Test mode or vice versa will access production data unexpectedly.
Install
-
pip install requests
Imports
- API client
import requests headers = { 'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/vnd.api+json', 'Content-Type': 'application/vnd.api+json' } response = requests.get('https://api.lemonsqueezy.com/v1/products', headers=headers)
Quickstart
import requests
import os
API_KEY = os.getenv('LEMON_SQUEEZY_API_KEY')
BASE_URL = 'https://api.lemonsqueezy.com/v1'
headers = {
'Authorization': f'Bearer {API_KEY}',
'Accept': 'application/vnd.api+json',
'Content-Type': 'application/vnd.api+json'
}
# List products
resp = requests.get(f'{BASE_URL}/products', headers=headers)
products = resp.json()['data']
for product in products:
print(product['id'], product['attributes']['name'])
# Verify webhook signature (HMAC-SHA256)
import hmac
import hashlib
def verify_webhook(payload: bytes, signature: str, secret: str) -> bool:
expected = hmac.new(
secret.encode(),
payload,
hashlib.sha256
).hexdigest()
return hmac.compare_digest(expected, signature)